package com.ruoyi.wb.enmus;


import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@ApiOperation(value = "维保计划执行状态枚举")
@Getter
@AllArgsConstructor
public enum PlanExecuteStatusEnums {

    TO_BEGIN(0,"待开始"),
    HAVE_IN_HAND(1,"进行中"),
    SUBMITTED(2,"已提交"),
    UNDER_REVIEW(3,"审核中"),
    REJECT(4,"驳回"),
    MAINTENANCE(5,"已维保"),
    COMPLETED(6,"已完成"),



    ;

    /**
     * 类型
     */
    private final Integer status;

    /**
     * 描述
     */
    private final String describe;


    /**
     * 获取枚举
     * @param status
     * @return
     */
    public static PlanExecuteStatusEnums getEnum(Integer status) {
        return Stream.of(PlanExecuteStatusEnums.values())
                .filter(p -> p.getStatus().equals(status))
                .findAny()
                .orElse(null);
    }

}
